jQuery(document).ready(function() {
	
	//创建JQGRID表格
	var grid = $("#table1").ligerGrid({
		columns: [
				  { display: '订单编号', name: 'ddCode', width: 150 },
                  { display: '物料编码', name: 'wlCode', width: 150},
                  { display: '物料名称', name: 'wlName', width: 150 },
                  { display: '规格型号', name: 'spec', width: 245 },
                  { display: '供应商编码', name: 'gysCode', width: 100 },
                  { display: '供应商名称', name: 'gysName', width: 100 },
                  { display: '收货日期', name: 'shrq', width: 100,
                	  render: function (item){
                		  if(item.shrq != null && item.shrq!=""){
                			  var shrq=new Date(item.shrq);
                			  return formatDate(shrq,"yyyy-MM-dd");
                		  }
                		  return '';
                	  }},
                  { display: '订单',columns: [
                        { display: '订单基本单位', name: 'ddJunit', width: 100},                     
						{ display: '订单基本数量', name: 'ddJquantity', width: 150 ,render:function(row){
							  
							  if(row.ddJquantity == null || row.ddJquantity == ''){
								  return '0.0';
							  }
							  return (row.ddJquantity).toFixed(4);
						}},
						{ display: '订单正常单位', name: 'ddUnit', width: 100},
						{ display: '订单正常数量', name: 'ddQuantity', width: 150 ,render:function(row){
							  
							  if(row.ddQuantity == null || row.ddQuantity == ''){
								  return '0.0';
							  }
							  return (row.ddQuantity).toFixed(4);
						}}
		               ]},
		               { display: '入库单号', name: 'rkCode', width: 150 },
		               { display: '入库',columns: [
						{ display: '入库基本单位', name: 'rkJunit', width: 100},                     
						{ display: '入库基本数量', name: 'rkJquantity', width: 150 ,render:function(row){
							  
							  if(row.rkJquantity == null || row.rkJquantity == ''){
								  return '0.0';
							  }
							  return (row.rkJquantity).toFixed(4);
						}},
						{ display: '入库正常单位', name: 'rkUnit', width: 100},
						{ display: '入库正常数量', name: 'rkQuantity', width: 150 ,render:function(row){
							  
							  if(row.rkQuantity == null || row.rkQuantity == ''){
								  return '0.0';
							  }
							  return (row.rkQuantity).toFixed(4);
						}}
							   ]},
					   { display: '未入库',columns: [
 						{ display: '未入库基本数量', name: 'wrkJquantity', width: 150 ,render:function(row){
 							  
 							  if(row.wrkJquantity == null || row.wrkJquantity == ''){
 								  return '0.0';
 							  }
 							  return (row.wrkJquantity).toFixed(4);
 						}},
 						{ display: '未入库正常数量', name: 'wrkQuantity', width: 150 ,render:function(row){
 							  
 							  if(row.wrkQuantity == null || row.wrkQuantity == ''){
 								  return '0.0';
 							  }
 							  return (row.wrkQuantity).toFixed(4);
 						}}
 							  ]},		   
 					{ display: '部门', name: 'department', width: 100 }
                  ],  usePager: true,pageSize:15,pageSizeOptions :[15,30,45,60],enabledSort:false,
                      url : basic_Url+"/list.do",
                      width: '100%', height: '98%', checkbox: false,rownumbers:true
                  });
	$("#pageloading").hide();
	
	
});
